1. Retrieve Branch ID (BID) of the Branch with name ‘Computer Science and Engineering’.
SELECT BID FROM Branches WHERE Branch_name = 'Computer Science and Engineering'
2. Retrieve Lecturers ID (LID), and Name in Descending Order of their ID.
SELECT LID,First_name FROM Lecturers ORDER BY LID DESC
3. Retrieve Lecturers ID (LID), Name, and Designation of Lecturers who belong to College ‘KSIT10’ in Descending order of their Names.
SELECT LID,First_name,Designation FROM Lecturers WHERE College = 'KSIT10' ORDER BY First_name DESC
4. Retrieve Usn, Subject ID (SID), and Subject CGPA of all the Students who have scored Greater than or equal to 9 CGPA.
SELECT Usn,SID,Subject_CGPA FROM Marks WHERE Subject_CGPA >= 9
5. Retrieve all information about Lecturers in Ascending Order of their Designation.
SELECT * FROM Lecturers ORDER BY Designation ASC
6. Retrieve all information about Lecturers in Ascending Order of their Names.
SELECT * FROM Lecturers ORDER BY First_name ASC
7. Retrieve Lecturer ID, name, and Designation details of the lecturer who is affiliated with the college 'SIT10'.
SELECT LID,First_name,Designation FROM Lecturers WHERE College = 'SIT10'
8. Retrieve Company ID CID, Name, and Package of all the Companies first in Descending Order of their Package and then in Ascending Order of their Names.
SELECT CID,Company_name,Package FROM Companies ORDER BY Package DESC,Company_name ASC;
9. Retrieve all information of Students Marks of Subject ID (SID) ‘24SQL’ in Descending Order of their Subject CGPA.
SELECT * FROM Marks WHERE SID = '24SQL' ORDER BY Subject_CGPA DESC;
10. Retrieve all information about the Students whose job role is ‘Python Developer’ in Descending order of their Package.
SELECT * FROM Students WHERE Job_role = 'Python Developer' ORDER BY Package DESC;
11. Retrieve Usn, Name, and CGPA of students who have a CGPA Greater Than 8.
SELECT Usn,First_name,CGPA FROM Students WHERE CGPA > 8;
12. Retrieve the Company Names that have packages Greater than 3 Lakh.
SELECT Company_name FROM Companies WHERE Package > 300000;
13. Retrieve Usn, Name, CGPA, Date of Joining, and Date of Graduation of students who have been placed as Data Analysts.
SELECT Usn,First_name,CGPA,DOJ,DOG FROM Students WHERE Job_role = 'Data Analyst'
14. Retrieve all information about Marks of Students ordered first by Subject CGPA in descending order and then by Test 3 scores in descending order.
SELECT * FROM Marks ORDER BY Subject_CGPA DESC,Test3 DESC;
15. Retrieve Usn, Name, Branch, CGPA, and Package of Students ordered first in Ascending order of Name, then in Descending Order of CGPA, and then in Descending order of their Package.
SELECT Usn,First_name,Branch,CGPA,Package FROM Students ORDER BY First_name ASC,CGPA DESC,Package DESC;